package com.jrx.anytxn.param.service.investor;

import com.jrx.anytxn.i18n.response.TxnPage;
import com.jrx.anytxn.common.exception.TxnException;
import com.jrx.anytxn.param.dto.investor.FundTableReq;
import com.jrx.anytxn.param.dto.investor.FundTableRes;
import com.jrx.anytxn.param.dto.investor.PrInvestorTableRes;
import com.jrx.anytxn.param.entity.PrFundFactor;
import com.jrx.anytxn.param.entity.PrFundTable;

import java.util.List;

/**
 * 资金源表 业务接口
 *
 * @author 黄秋平
 * @Date 2020-5-14 10:27:23
 */
public interface IFundTableService {

    /**
     * 根据租户ID分页查询资金源参数信息
     * @param pageNum
     * @param pageSize
     * @param tenantId
     * @return
     * @throws TxnException
     */
    TxnPage<FundTableRes> findAllPageByTenId(Integer pageNum, Integer pageSize, String tenantId) throws TxnException;

    /**
     * 添加资金源参数
     * @param fundTableReq
     * @return
     * @throws TxnException
     */
    FundTableRes addFundTable(FundTableReq fundTableReq) throws TxnException;

    /**
     * 更新资金源参数
     * @param fundTableReq
     * @return
     * @throws TxnException
     */
    FundTableRes modifyFundTable(FundTableReq fundTableReq) throws TxnException;

    /**
     * 根据租户id和资金源id删除资金源参数
     * @param tenantId
     * @param fundId
     * @return
     * @throws TxnException
     */
    Boolean removeByFundIdAndTenId(String tenantId , String fundId) throws TxnException;

    /**
     * 根据租户id和资金源id查询资金源参数
     * @param tenantId
     * @param fundId
     * @return
     * @throws TxnException
     */
    FundTableRes findByFundIdAndTenId(String tenantId , String fundId) throws TxnException;

    /**
     * 获取资金源下拉列表
     * @param tenantId
     * @return
     */
    List<PrFundTable> findAllByTenId(String tenantId);

    /**
     * 根据资金源id集合获取资金方id
     *
     * @param fundIds 资金源id
     * @param tenantId 租户id
     * @return List<PrFundFactor>
     * @throws TxnException
     * @author liuyang
     * @date 2020-6-9
     */
    List<PrFundFactor> findByFundIdsAndTenId(List<String> fundIds, String tenantId) throws TxnException;

    /**
     * 根据资金源ID查询出资方相关信息
     * @author fan.yang
     * date: 2020/6/23 0023 上午 11:58
     * @param tenantId 租户ID
     * @param fundId 资金源ID
     * @return java.util.List<com.jrx.anytxn.param.dto.investor.PrInvestorTableRes>
     */
    List<PrInvestorTableRes>  findInvestorByFundIdAndTenId(String tenantId, String fundId) throws TxnException;
}
